<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>roots</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 02/11/2005</div>
    <p>
      <b>roots</b> -  roots of polynomials</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[x]=roots(p)  </tt>
      </dd>
      <dd>
        <tt>[x]=roots(p,'e')  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>p</b>
        </tt>: polynomial with real or complex coefficients  or vector of the
	    polynomial coefficients in decreasing degree order (Matlab
	    compatibility).</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>x=roots(p)</b>
      </tt> returns in the complex vector <tt>
        <b>x</b>
      </tt> the roots of the 
    polynomial <tt>
        <b>p</b>
      </tt>. For real polynomials of degree &lt;=100 the fast
      RPOLY algorithm is used. In the other cases the roots are computed as the
      eigenvalues of the associated companion matrix. Use
      <tt>
        <b>x=roots(p,'e')</b>
      </tt> to force this algorithm in any cases.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

p=poly([0,10,1+%i,1-%i],'x');
roots(p)
A=rand(3,3);roots(poly(A,'x'))    // Evals by characteristic polynomial
spec(A) 
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="../programming/poly.htm">
        <tt>
          <b>poly</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../linear/spec.htm">
        <tt>
          <b>spec</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../linear/companion.htm">
        <tt>
          <b>companion</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>Serge Steer (INRIA)</dd>
    </dl>
    <h3>
      <font color="blue">Bibliography</font>
    </h3>The RPOLY algorithm is described in ACM TOMS 1 (1975) 178-189<h3>
      <font color="blue">Used Function</font>
    </h3>The rpoly.f source codes can be found in the directory routines/control
      of a Scilab source distribution. The
      eigenvalue computation is perfomed using DGEEV and ZGEEV LAPACK codes. </body>
</html>
